package com.iplay.实战java高并发程序设计.chapter5.c51;

/**
 * 综合了懒汉式和饿汉式
 *
 * @author dangwu
 * @since 2021/11/5 11:00 上午
 */
public class StaticSingleton {
    private StaticSingleton() {
        System.out.println("StaticSingleton is create");
    }

    private static class SingletonHolder {
        private static StaticSingleton instance = new StaticSingleton();
    }

    public static StaticSingleton getInstance() {
        return SingletonHolder.instance;
    }
}
